package com.moss.cloud.auth.biz.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.moss.cloud.auth.biz.mapper.SysUserRoleMapper;
import com.moss.cloud.auth.biz.service.ISysUserRoleService;
import com.moss.cloud.common.base.model.po.SysUserRole;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * 用户角色服务层实现
 * @author 瑾年
 * @data 2023年3月6日
 */
@Slf4j
@Service
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper,SysUserRole> implements ISysUserRoleService {
    /**
     * 根据用户ID查询用户角色
     * @param userId
     * @return
     */
    @Override
    public List<SysUserRole> findRoleIdByUserId(Long userId){
        return this.list(new QueryWrapper<SysUserRole>()
                .lambda()
                .eq(SysUserRole::getUserId,userId));
    }
}
